package com.geostart.constructionland.system.controller;

import com.geostar.constructionland.common.entity.response.ExtJsAjaxResponse;
import com.geostar.constructionland.common.entity.statistics.PostAnalyse;
import com.geostart.constructionland.system.service.PostAnalyseFeignClient;
import io.swagger.annotations.Api;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import javax.validation.Valid;

@Api
@Controller
public class PostAnalyseController {
    @Resource
    PostAnalyseFeignClient postAnalyseFeignClient;

    // 数据查询页面接口
    @GetMapping(path = "/postAnalyse/profile")
    public String unfiedDataQueryprofile() {
        return "profile/post_analyse_profile";
    }

    @ResponseBody
    @PostMapping(path = "/postAnalyse/list")
    public ExtJsAjaxResponse unifiedQueryConfiglist(
            @RequestParam(value = "page") int pageNo,
            @RequestParam(value = "limit") int pageNum,
            String query_param_task_id) {
        return postAnalyseFeignClient.udqList(pageNo, pageNum, query_param_task_id);
    }

    @ResponseBody
    @PostMapping(path = "/postAnalyse/delete")
    public ExtJsAjaxResponse unifiedQueryConfigConfigFeignClient(String id) {
        return postAnalyseFeignClient.udqDelete(id);
    }

    @ResponseBody
    @PostMapping(path = "/postAnalyse/add")
    public ExtJsAjaxResponse unifiedQueryConfigConfigadd(@Valid PostAnalyse postAnalyse) {
        return postAnalyseFeignClient.udqAdd(postAnalyse);
    }

    @ResponseBody
    @PostMapping(path = "/postAnalyse/update")
    public ExtJsAjaxResponse unifiedQueryConfigConfigcreate(@Valid PostAnalyse postAnalyse) {
        return postAnalyseFeignClient.udqUpdate(postAnalyse);
    }

}
